<div>
<form class="form-horizontal" role="form" name="upayAssessForm" novalidate>
  <div class="form-ctrl md-whiteframe-z1">
    <div class="form-search" style="height:160px;" ng-class="{true: 'shou'}[flag.formIsFold]" ng-switch="upayAssessment.timeType.timeTypeCode">
      <div>
        <label style="">账期</label>
        <md-select ng-model="upayAssessment.timeType">
          <md-select-label>{{upayAssessment.timeType ? _getNames(upayAssessment.timeType,'timeTypeName',selector.timeType) : "日"}}</md-select-label>
          <md-option ng-value="timeType" ng-repeat="timeType in selector.timeType" >{{timeType.timeTypeName}}</md-option>
        </md-select>
      </div>
      <input-quarter-group start-time="upayAssessment.quarter.startTime" end-time="upayAssessment.quarter.endTime" ng-switch-when="4"></input-quarter-group>
      <div ng-if="!upayAssessment.timeType || upayAssessment.timeType.timeTypeCode !== '4'">
        <md-input-container flex>
          <label >开始时间</label>
          <input name="dateStartTime" type="date" end-time="date.endTime" time-validate="day" ng-model="date.startTime"  ng-switch-default required>
          <div ng-messages="upayAssessForm.dateStartTime.$error">
            <div ng-message="date">请正确输入时间</div>
            <div ng-message="time-error">开始时间不应大于结束时间</div>
          </div>
          <input name="monthStartTime" ng-model="date.startTime"  end-time="date.endTime" time-validate="month"  type="month" ng-switch-when="3" required>
          <div ng-messages="upayAssessForm.monthStartTime.$error">
            <div ng-message="date">请正确输入时间</div>
            <div ng-message="time-error">开始时间不应大于结束时间</div>
          </div>
          <input ng-model="date.startTime"  end-time="date.endTime" type="number" time-validate="year"  ng-switch-when="5" name="startQuarter" required>
          <div ng-messages="upayAssessForm.startQuarter.$error">
            <div ng-message="required">请正确输入时间</div>
            <div ng-message="time-error">开始时间不应大于结束时间</div>
          </div>
        </md-input-container >
      </div>
      <div ng-if="!upayAssessment.timeType || upayAssessment.timeType.timeTypeCode !== '4'">
        <md-input-container flex>
          <label>结束时间</label>
          <input name="dateEndTime" type="date" ng-model="date.endTime"  start-time="date.startTime" time-validate="day" ng-switch-default required>
          <div ng-messages="upayAssessForm.dateEndTime.$error">
            <div ng-message="date">请正确输入时间</div>
            <div ng-message="time-error">结束时间不应小于开始时间</div>
            <div ng-message="too-great">结束时间不应大于当前时间</div>
          </div>
          <input name="monthEndTime" ng-model="date.endTime"  type="month" start-time="date.startTime" time-validate="month" ng-switch-when="3" required>
          <div ng-messages="upayAssessForm.monthEndTime.$error">
            <div ng-message="date">请正确输入时间</div>
            <div ng-message="time-error">结束时间不应小于开始时间</div>
            <div ng-message="too-great">结束时间不应大于当前时间</div>
          </div>
          <input ng-model="date.endTime"  start-time="date.startTime" type="number" time-validate="year" ng-switch-when="5" name="endQuarter" required>
          <div ng-messages="upayAssessForm.endQuarter.$error">
            <div ng-message="required">请正确输入时间</div>
            <div ng-message="time-error">结束时间不应小于开始时间</div>
            <div ng-message="too-great">结束时间不应大于当前时间</div>
          </div>
        </md-input-container >
      </div>
    </div>
    <i class="glyphicon glyphicon-chevron-up shrinkage" ng-click="flag.formIsFold=true" ng-show="flag.showTable &&!(quarterInvalid||upayAssessForm.$invalid)"></i>
    <md-button ng-click="upayAssessQuery()" ng-disabled="quarterInvalid||upayAssessForm.$invalid" class="md-fab md-primary md-hue-1" aria-label="Profile">
      <i class="glyphicon glyphicon-search"  ng-show="!flag.formIsFold"></i>
      <i class="glyphicon glyphicon-arrow-down" style="margin-top:28px;" ng-show="flag.formIsFold"></i>
    </md-button>
  </div>
</form>
<div class="table-info" ng-controller="upayAssessViewCtrl">
  <div ng-show="flag.showTable">
    <div class="menus">
      <form action="{{exportUrl}}"  target="_black"  method="post" >
        <input type='hidden' name="data"  value='{{viewObj.exportParam}}'>
        <md-button  type="submit"  class="md-raised">导出Excel</md-button>
      </form>
    </div>
    <div class="table-detail">
      <div class="t_r" style="padding: 30px 0px;">
        <table class="table table-bordered">
        <caption style="text-align:center;font-size:large;font-weight:bold;color:black">{{flag.title}}</caption>
          <thead>
            <tr>
              <th width="20%">考核区间</th>
              <th width="20%">交易总笔数</th>
              <th width="20%">交易失败笔数</th>
              <th width="20%">交易成功率</th>
              <th width="20%">得分</th>
            </tr>
          </thead>
          <tbody>
            <tr class="summary">
              <td width="20%">{{viewObj.duration}}</td>
              <td width="20%">{{viewObj.series.tradeAmount}}</td>
              <td width="20%">{{viewObj.series.failTradeAmount}}</td>
              <td width="20%">{{viewObj.series.successRate+'%'}}</td>
              <td width="20%">{{viewObj.series.assessmentPoints}}</td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</div>
</div>